5. Prove that the algorithm terminates.